<div id="syncFunTree" class="demo-tree"></div>

<script>
    layui.use('tree', function() {
        var tree = layui.tree
            ,layer = layui.layer
            ,util = layui.util

        let cid = $('#eConfigId1').val();
        // 加载菜单及按钮数据
        $.ajax({
            type:'get',
            url:'mysql/getMasterFunList?configId='+cid,
            success: function (res) {
                if (res.errorCode == '0') {
                    // res.data
                    tree.render({
                        elem: '#syncFunTree',
                        id:'syncCheckFunId',
                        data: res.data,
                        showCheckbox: true
                    });

                }else {
                    layer.msg(res.desc);
                }
            }
        });

    });

</script>